home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / longname.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  4KB  |  112 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #define    CURSES_LIBRARY    1
  4. #include <curses.h>
  5. #ifdef UNIX
  6. #include <defs.h>
  7. #include <term.h>
  8. #endif
  9. #undef    longname
  10.  
  11. #ifdef PDCDEBUG
  12. char *rcsid_longname = "$Header: C:\CURSES\portable\RCS\longname.c 2.1 1993/06/18 20:19:24 MH Rel MH $";
  13. #endif
  14.  
  15.  
  16.  
  17.  
  18. #ifdef    FLEXOS
  19. extern    char*    _flexos_gname();
  20. #endif
  21.  
  22. static    char    _display[ 128 ];
  23.  
  24.  
  25.  
  26.  
  27. /*man-start*********************************************************************
  28.  
  29.   longname()    - return full terminal type name
  30.  
  31.   X/Open Description:
  32.      This function returns a pointer to a static area containing a
  33.      verbose description of the current terminal.  The maximum length
  34.      of the string is 128 characters.  It is defined only after the
  35.      call to initscr() or newterm().  The area is overwritten by each
  36.      call to newterm() and is not restored by set_term().  The value
  37.      should therefore be saved between calls to newterm(), if
  38.      longname() is going to be used with multiple terminals.
  39.  
  40.   PDCurses Description:
  41.      In addition to the above definition, the form of this string is
  42.      the adapter name (or video card name) and the text resolution.
  43.      This may also be followed by the notation that the video card
  44.      may be a clone, which indicates that the card identification
  45.      maps to more than one unique card.
  46.  
  47.      e.g. The MDS Genius and the Quadram QuadHPG identify themselves
  48.      in the same manner, but are vastly different in maximum resolution.
  49.  
  50.   X/Open Return Value:
  51.      The longname() function returns a pointer to a verbose description
  52.      of the current terminal on success and the null pointer on error.
  53.  
  54.   X/Open Errors:
  55.      No errors are defined for this function.
  56.  
  57.   Portability:
  58.      PDCurses    char* longname( void );
  59.      X/Open Dec '88    char* longname( void );
  60.      BSD Curses    char* longname( void );
  61.      SYS V Curses    char* longname( void );
  62.  
  63. **man-end**********************************************************************/
  64.  
  65. char*    longname(void)
  66. {
  67. #ifdef PDCDEBUG
  68.     if (trace_on) PDC_debug("longname() - called\n");
  69. #endif
  70.  
  71. #ifdef UNIX
  72.     strcpy(_display,_CUR_TERM.name_long);
  73. #else
  74.  
  75. #ifdef     OS2
  76.     switch    (_cursvar.adapter.adapter)
  77.     {
  78.     case DISPLAY_CGA:    sprintf(_display, "CGA-%dx%d", LINES, COLS);      break;
  79.     case DISPLAY_MONOCHROME:    sprintf(_display, "MDA-%dx%d", LINES, COLS);      break;
  80.     case DISPLAY_EGA:    sprintf(_display, "EGA-%dx%d", LINES, COLS); break;
  81.     case DISPLAY_VGA:    sprintf(_display, "VGA-%dx%d", LINES, COLS); break;
  82.     case DISPLAY_8514A:     sprintf(_display, "8514-%dx%d", LINES, COLS);  break;
  83. #endif
  84.  
  85. #ifdef DOS
  86.     switch    (_cursvar.adapter)
  87.     {
  88.     case _CGA:    sprintf(_display, "CGA-%dx%d", LINES, COLS);      break;
  89.     case _MDA:    sprintf(_display, "MDA-%dx%d", LINES, COLS);      break;
  90.     case _EGACOLOR:    sprintf(_display, "EGAColor-%dx%d", LINES, COLS); break;
  91.     case _EGAMONO:    sprintf(_display, "EGAMono-%dx%d", LINES, COLS);  break;
  92.     case _VGACOLOR:    sprintf(_display, "VGAColor-%dx%d", LINES, COLS); break;
  93.     case _VGAMONO:    sprintf(_display, "VGAMono-%dx%d", LINES, COLS);  break;
  94.     case _MCGACOLOR:sprintf(_display, "MCGAColor-%dx%d", LINES, COLS);break;
  95.     case _MCGAMONO:    sprintf(_display, "MCGAMono-%dx%d", LINES, COLS); break;
  96.     case _MDS_GENIUS:sprintf(_display, "Genius-%dx%d", LINES, COLS);  break;
  97. #endif
  98.  
  99. #ifdef    FLEXOS
  100.     case _FLEXOS:    sprintf(_display, "%s", _cursesgname());      break;
  101. #endif
  102.  
  103.     default:    sprintf(_display, "Unknown-%dx%d", LINES, COLS);  break;
  104.     }
  105.  
  106.     if (_cursvar.bogus_adapter)
  107.         strcat(_display, " (Clone)");
  108. #endif
  109.  
  110.     return (_display);
  111. }
  112.